<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>广告联调平台</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="../layui/css/layui.css" rel="stylesheet">
</head>
<body>
  <div class="layui-layout layui-layout-admin">
    <div class="layui-header">
      <div class="layui-logo layui-hide-xs layui-bg-black">广告联调平台</div>
      <!-- 头部区域（可配合layui 已有的水平导航） -->
      <ul class="layui-nav layui-layout-right">
        <li class="layui-nav-item layui-hide layui-show-sm-inline-block">
          <a>
            <img src="../img/yonghu.png" class="layui-nav-img">
            <span id="uName"></span>
          </a>
          <dl class="layui-nav-child">
            <dd><a lay-on="confirm">退出登录</a></dd>
          </dl>
        </li>
      </ul>
    </div>
    <div class="layui-side layui-bg-black">
      <div class="layui-side-scroll">
        <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
        <ul class="layui-nav layui-nav-tree" lay-filter="test">
          <li class="layui-nav-item layui-nav-itemed"><a href="../admin.html">首页</a></li>
          <li class="layui-nav-item">
            <a class="" href="javascript:;">oppo</a>
            <dl class="layui-nav-child">
              <dd><a href="../oppo/oppoIndex.html">数据汇总</a></dd>
              <dd><a href="../admin.html">数据明细</a></dd>
              <dd><a href="../admin.html">链接管理</a></dd>
              <dd><a href="../oppo/create.html">链接创建</a></dd>
            </dl>
          </li>
          <li class="layui-nav-item">
            <a class="" href="javascript:;">优酷</a>
            <dl class="layui-nav-child">
                <dd><a href="selecteff.html">有效触点监测地址</a></dd>  
                <dd><a href="effpoint.html">有效触点链接</a></dd>
                <dd><a href="selectadinfo.html">联调触点列表</a></dd>
                <dd><a href="xianyuinfo.html">闲鱼触点列表</a></dd>    
            </dl>
          </li>
          <li class="layui-nav-item">
            <a class="" href="javascript:;">淘宝</a>
            <dl class="layui-nav-child">
                <dd><a href="../taobao/deeplinkTb.html">deeplink转换工具</a></dd>
            </dl>
          </li>
          <li class="layui-nav-item"><a href="../admin.html">完善信息</a></li>
        </ul>
      </div>
    </div>
    <div class="layui-body">
        <blockquote class="layui-elem-quote layui-text">
          有效触点监测地址
        </blockquote>
        <!-- 内容主体区域 -->
        <div class="layui-card layui-panel">
          <div class="layui-card-body">
            <table class="layui-hide" id="ID-table-demo-data"></table>
          </div>
        </div>
    </div>
    <div class="layui-footer" style="text-align: center;">
      <!-- 底部固定区域 -->
      冀ICP备2025105329号
    </div>
  </div>

  <script src="../layui/layui.js"></script>
  <script>
    //JS
    layui.use(['form','element', 'layer', 'util'], function(){
      var form = layui.form;
      var element = layui.element;
      var layer = layui.layer;
      var util = layui.util;
      var $ = layui.$;
      var query = layui.jquery;
      var table = layui.table;
      var userInfo = {};

      window.onload = function() {
        query.ajax({
          type:"POST",
          url:"/user/queryUser",
          success:function(result){
            if (result.success === true) {
              userInfo = result.user;
              $('#uName').text(userInfo.mobileNo);
            } else {
              layer.alert('获取用户信息失败，请重新登录！', {
                title: '发生错误'
              });
              setTimeout(function(){
                window.location.href = "/";
              }, 1500)
            }
          },
          error:function(){
            layer.alert('访问链接不存在！', {
              title: '发生错误'
            });
          }
        });

        query.ajax({
            type:"POST",
            contentType:"application/json;charset=UTF-8",
            data:{},
            dataType:"json",
            url:"/youku/selectEffpoint",
            success:function(result){
                if (result.code === 200) {
                var inst = table.render({
                    elem: '#ID-table-demo-data',
                    title:'链接列表',
                    cols: [
                    [ //标题栏
                        {field: 'id', title: '序号', width: 80, sort: true},
                        {field: 'appKey', title: '子客户密钥appKey', width: 200},
                        {field: 'token', title: '子客户token', width: 300},
                        {field: 'event_typeStr', title: '回传事件类型', width: 120},
                        {field: 'deep_convStr', title: '是否深度转化', width: 120},
                        {field: 'transform', title: '转化因子', width: 100},
                        {field: 'url', title: '生成链接', width: 600},
                        {field: 'lid', title: '闲鱼渠道参数', width: 120},
                        {field: 'xianyuUrl', title: '闲鱼手机端链接（安卓或IOS）', width: 200},
                        {field: 'chooseStr', title: '闲鱼上报(曝光/点击)', width: 100}
                    ]
                    ],//设置表头
                    data: result.data,//设置数据
                    page: true, // 是否显示分页
                    limits: [10, 20, 50],
                    limit: 10 // 每页默认显示的数量
                });
                } else {
                    layer.alert('获取用户信息失败，请重新登录！', {
                        title: '发生错误'
                    });
                }
            },
            error:function(){
                layer.alert('访问链接不存在！', {
                title: '发生错误'
                });
            }
        });

      };


      util.on('lay-on',{
        confirm: function() {
          layer.confirm('是否退出登录？', {
            btn: ['确定']
          }, function(){
            query.ajax({
              type:"GET",
              url:"/user/logout",
              success:function(result){
                if (result.success === true) {
                  layer.msg(result.msg, { icon:1 });
                  setTimeout(function(){
                    window.location.href = "/";
                  }, 1500)
                } else {
                  layer.msg(result.msg, { icon:2 });
                }
              },
              error:function(){
                layer.alert('访问链接不存在！', {
                  title: '发生错误'
                });
              }
            })
          })
        }
      });

      

    });
  </script>

</body>
</html>